package com.waves.design.strategy;

/**
 * 儿童折扣类
 * 具体策略类
 * 抽象策略类的多个方法实现类之一
 */
public class ChildrenDiscount implements Discount {
    private final double DISCOUNT = 10;

    public double calculate(double price){
        System.out.println("儿童票：");
        if (price >= 20){
            return price - DISCOUNT;
        } else {
            return price;
        }
    }
}
